<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
<!-- 编辑器公式插件 -->
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<div class="span10" id="datacontent">

    <ul class="breadcrumb">
        <li><a href="/exercise/index/index">剑雅真题</a> <span class="divider">/</span></li>
        <li><a href="/exercise/listening/index">听力练习</a> <span class="divider">/</span></li>
        <li class="active">修改题目</li>
    </ul>
    <form action="/exercise/listening/update?cate_id=<?php echo $cate_id?>" method="post" class="form-horizontal">
        <fieldset>
            <div class="control-group">
                <label for="area" class="control-label">主分类：</label>
                <div class="controls">
                    <input type="text" name="catName" value="<?php echo $data->catName?>" readonly>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">名称：</label>
                <div class="controls">
                    <input type="text" name="name" value="<?php echo $data->name?>">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">标题：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data->title?>" name="title">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">标题图片：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data->title_image?>" class="title_image" name="title_image">
                    <a href="#" class="btn btn-info" onclick="upImage3()">上传文件</a>
                </div>
            </div>

            <div class="control-group">
                <label for="area" class="control-label">题目图片：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data->image?>" class="image" name="image">
                    <a href="#" class="btn btn-info" onclick="upImage4()">上传文件</a>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">浏览量：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data->viewCount?>" name="viewCount">
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">听力文件：</label>
                <div class="controls">
                    <textarea name="listeningFile"><?php echo $data->listeningFile?></textarea>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">描述：</label>
                <div class="controls">
                    <textarea id="sss" name="description" style="width: 90%;height: 400px;"><?php echo $data->description?></textarea>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">文章：</label>
                <div class="controls">
                    <textarea id="sss2" name="article" style="width: 90%;height: 400px;"><?php echo $data->article?></textarea>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">题型：</label>
                <div class="controls">
                    <select name="type" id="">
                    <?php foreach ($option['type'] as $k => $v): ?>
                            <option <?php echo $data->type==$v['id'] ? "selected=selected" : ""?> value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
                            
                        <?php endforeach ?>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">难度：</label>
                <div class="controls">
                    <select name="level" id="">
                    <?php foreach ($option['level'] as $k => $v): ?>
                            <option <?php echo $data->level==$v['id'] ? "selected=selected" : ""?> value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
                            
                        <?php endforeach ?>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">话题：</label>
                <div class="controls">
                    <select name="topic" id="">
                    <?php foreach ($option['topic'] as $k => $v): ?>
                            <option <?php echo $data->topic==$v['id'] ? "selected=selected" : ""?> value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
                            
                        <?php endforeach ?>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label for="area" class="control-label">问题类型：</label>
                <div class="controls">
                    <input type="text" value="<?php echo $data->questionType?>" name="questionType">
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button class="btn btn-primary" type="submit">提交</button>
                    <input type="hidden" name="id" value="<?php echo $id?>"/>
                </div>
            </div>
        </fieldset>
    </form>
</div>
<script>
    //实例化编辑器
    //描述
    var o_ueditorupload = UE.getEditor('sss',
        {
            autoHeightEnabled:false
        });
    // 文章
    var o_ueditorupload2 = UE.getEditor('sss2',
        {
            autoHeightEnabled:false
        });
    
    
    // 标题图片
    var o_ueditorupload3 = UE.getEditor('j_ueditorupload3',
        {
            autoHeightEnabled:false
        });
    o_ueditorupload3.ready(function ()
    {

        o_ueditorupload3.hide();//隐藏编辑器

        //监听图片上传
        o_ueditorupload3.addListener('beforeInsertImage', function (t,arg)
        {
            $('.title_image').val(arg[0].src);

        });

        /* 文件上传监听
         * 需要在ueditor.all.min.js文件中找到
         * d.execCommand("insertHtml",l)
         * 之后插入d.fireEvent('afterUpfile',b)
         */
        o_ueditorupload3.addListener('afterUpfile', function (t, arg)
        {

        });
    });

    function upImage3()
    {
        var myImage3 = o_ueditorupload3.getDialog("insertimage");
        myImage3.open();
    }

    var o_ueditorupload4 = UE.getEditor('j_ueditorupload4',
        {
            autoHeightEnabled:false
        });
    o_ueditorupload4.ready(function ()
    {

        o_ueditorupload4.hide();//隐藏编辑器

        //监听图片上传
        o_ueditorupload4.addListener('beforeInsertImage', function (t,arg)
        {
            $('.image').val(arg[0].src);

        });

        /* 文件上传监听
         * 需要在ueditor.all.min.js文件中找到
         * d.execCommand("insertHtml",l)
         * 之后插入d.fireEvent('afterUpfile',b)
         */
        o_ueditorupload4.addListener('afterUpfile', function (t, arg)
        {

        });
    });

    function upImage4()
    {
        var myImage4 = o_ueditorupload4.getDialog("insertimage");
        myImage4.open();
    }

</script>
<script type="text/plain" id="sss"></script>
<script type="text/plain" id="sss2"></script>
<script type="text/plain" id="j_ueditorupload3"></script>
<script type="text/plain" id="j_ueditorupload4"></script>